package com.jiyun.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiyun.feign.OrderFeignService;
import com.jiyun.feign.UserFeignService;
import com.jiyun.mapper.RiderQueueMMapper;
import com.jiyun.pojo.NCustomer;
import com.jiyun.pojo.RiderQueue;
import com.jiyun.service.IRiderQueueMService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2024-11-25
 */
@Service
public class RiderQueueMServiceImpl extends ServiceImpl<RiderQueueMMapper, RiderQueue> implements IRiderQueueMService {
    @Autowired
    private RiderQueueMMapper RiderQueueMapper;
    @Override
    public List<RiderQueue> findAll() {
        return RiderQueueMapper.findAll();
    }

    @Override
    public List<RiderQueue> getStatusFind(Integer status,Integer did) {
        return RiderQueueMapper.getStatusFind(status,did);
    }

    @Autowired
    private UserFeignService userFeignService;
    @Override
    public RiderQueue findOne(String orderId) {
        RiderQueue list= RiderQueueMapper.findOne(orderId);
        List<NCustomer> one = userFeignService.findOne();
//        for (NCustomer nCustomer : one) {
//            if (nCustomer.getId().equals(list.getOPassname())){
//                list.setUserName(nCustomer.getRealName());
//                list.setPhone(nCustomer.getPhone());
//            }
//        }
        return list;
    }

    @Override
    public void updateOrder(Integer id, String drivervaluation) {
        RiderQueueMapper.updateOrder(id,drivervaluation);
    }

    @Autowired
    private OrderFeignService orderFeignService;
    @Override
    public List<RiderQueue> findPhone(Integer did) {
        List<RiderQueue> phone1 = RiderQueueMapper.findPhone(did);
        return phone1;
    }

    @Override
    public RiderQueue findEndOne(Integer id, Integer did) {
        return RiderQueueMapper.findEndOne(id,did);
    }


}
